#include <bits/stdc++.h>

using namespace std;

class Solution
{
public:
    int jump(vector<int> &nums)
    {
        vector<int> f(nums.size() + 1, INT_MAX);
        f[1] = 0;
        for (int i = 1; i <= nums.size(); ++i)
        {
            for (int j = 1; j < i; ++j)
            {
                if (i - j <= nums[j - 1])
                {
                    f[i] = min(f[i], f[j] + 1);
                }
            }
        }
        return f[nums.size()];
    }
};

int main()
{
    Solution a;
    vector<int> s = {1, 2, 3};
    a.jump(s);
    return 0;
}